<!DOCTYPE html>
<html>
    
    <head>
        <title>修改IP地址</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <!-- Bootstrap -->
        <link href="View/FAST/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="View/FAST/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="View/FAST/assets/styles.css" rel="stylesheet" media="screen">
        <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="vendors/flot/excanvas.min.js"></script><![endif]-->
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="View/FAST/vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    
    <body>
    {include h}

        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span2" ></div>
                <div class="span8" id="content">
                      <!-- morris stacked chart -->
                    <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">网络设置</div>
                            </div>
                            {foreach $resIps as $k=>$v}
                            <div class="block-content collapse in">
                                <div class="span12">
                                     <form class="form-horizontal" >
                                      <fieldset>
                                          <legend>业务网口{$k+1}[{$v.ethname}]<span class="label label-info">{$v.speed}</span></legend>
                                          <input class="input-xlarge focused" style="display: none" name="ethname" type="text" value="{$v.ethname}" >
                                          {if $k==0}
                                          <input class="input-xlarge focused" style="display: none" name="manage" type="text" value="manage" >
                                          {/if}
                                        <div class="control-group">
                                          <label class="control-label" >IP:</label>
                                          <div class="controls">
                                            <input class="input-xlarge focused" name="ip2" type="text" value="{$v.ip2}" >
                                              <span class="help-inline">例:122.3.4.5/24</span>
                                          </div>
                                        </div>

                                          <div class="control-group">
                                              <label class="control-label">网关:</label>
                                              <div class="controls">
                                                  <input class="input-xlarge focused"  name="gateway" type="text" value="{$v.gateway}" >
                                                  <span class="help-inline">例:122.3.4.1,只能为1个网口设置网关，否则会路由冲突</span>
                                              </div>
                                          </div>
                                        <div class="form-actions">
                                          <button  class="btn btn-primary submit">提交</button>
                                          <button  class="btn btn-success blink">闪灯</button>
                                         
                                        </div>
                                      </fieldset>
                                    </form>
                                </div>
                            </div>
                            {/foreach}
                        </div>
                        <!-- /block -->
                    </div>

                </div>
                <div class="span2" ></div>
            </div>
            <hr>
           {include f}
        </div>
        <!--/.fluid-container-->
        <link href="View/FAST/vendors/datepicker.css" rel="stylesheet" media="screen">
        <link href="View/FAST/vendors/uniform.default.css" rel="stylesheet" media="screen">
        <link href="View/FAST/vendors/chosen.min.css" rel="stylesheet" media="screen">

        <link href="View/FAST/vendors/wysiwyg/bootstrap-wysihtml5.css" rel="stylesheet" media="screen">

        <script src="View/FAST/vendors/jquery-1.9.1.js"></script>
        <script src="View/FAST/bootstrap/js/bootstrap.min.js"></script>
        <script src="View/FAST/vendors/jquery.uniform.min.js"></script>
        <script src="View/FAST/vendors/chosen.jquery.min.js"></script>
        <script src="View/FAST/vendors/bootstrap-datepicker.js"></script>

        <script src="View/FAST/vendors/wysiwyg/wysihtml5-0.3.0.js"></script>
        <script src="View/FAST/vendors/wysiwyg/bootstrap-wysihtml5.js"></script>

        <script src="View/FAST/vendors/wizard/jquery.bootstrap.wizard.min.js"></script>


        <script src="View/FAST/assets/scripts.js"></script>
        <script>
        $(function() {

            $(".datepicker").datepicker();
            $(".uniform_on").uniform();
            $(".chzn-select").chosen();
            $('.textarea').wysihtml5();

            $(".submit").click(function(e){
                var postdata = $(this).closest("form").serializeArray();
                console.log( postdata);
                $.ajax({
                    url:"?setip/Setip?",
                    type:"post",
                    dataType:"json",
                    async:false,
                    data:postdata,
                    success:function(r){
                    }
                });
                alert("3秒后自动刷新，请稍等......");

                setTimeout(function(){
                    alert("刷新......");
                    window.location.reload();
                },3000);
                return false;
            });

            $(".blink").click(function(e){
                var postdata = $(this).closest("form").serializeArray();
                //console.log( postdata);
                $.ajax({
                    url:"?setip/blink?",
                    type:"post",
                    dataType:"json",
                    async:false,
                    data:postdata,
                    success:function(r){
                    }
                });
                alert("网卡5秒后停止闪烁");

                return false;
            });


        });
        </script>
    </body>

</html>